cmake_minimum_required(VERSION 3.16)

project(CircularMenu VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找Qt6包
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)

# 启用Qt MOC
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

# 源文件
set(SOURCES
    main.cpp
    roundmenuwidget.cpp
)

# 头文件
set(HEADERS
    roundmenuwidget.h
)

# 创建可执行文件
add_executable(CircularMenu ${SOURCES} ${HEADERS})

# 链接Qt库
target_link_libraries(CircularMenu Qt6::Core Qt6::Widgets)

# Windows特定设置
if(WIN32)
    set_target_properties(CircularMenu PROPERTIES
        WIN32_EXECUTABLE TRUE
    )
endif()

# 设置编译选项
if(MSVC)
    target_compile_options(CircularMenu PRIVATE /W4)
else()
    target_compile_options(CircularMenu PRIVATE -Wall -Wextra -Wpedantic)
endif()

# 安装规则
install(TARGETS CircularMenu
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
